<?php

namespace app\yunda\validate;
use think\Validate;
class Person extends Validate
{
    //定义验证规则
    protected $rule = [
//        'name|姓名' => 'require|max:30',
//        'sex|性别' => 'require',
//        'birthday|出生日期' => 'require',
        'card|身份证号' => 'require|regex:^[1-9]\d{9}[0,1]{1}\d{1}[0,1,2,3]{1}\d{4}[0-9Xx]$',
        'phone|手机号' => 'require|regex:^1[3,5,6,7,8]{1}\d{9}$',
        'email|邮箱' => 'email',
        'home|所在地区' => 'require',
        'address|详细地址' => 'require',
        'post_code|邮编' => 'require',
    ];

    //定义验证提示
    protected $message = [
        'name.max' => '姓名最多30个字符',
        'card.regex' => '身份证号码错误',
        'phone.regex' => '手机号码不正确',

    ];
}
